package com.teach;

/**
 * <pre>
 * -
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2021-04-12 16:16
 * Version : 1.0
 * Copyright 2021 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
public class Demo04 {

  public static void main(String[] args) {
    String str = "http://www.jlzhou.top/a/b/c/index.html";
    System.out.println(str.substring(0,4));
    System.out.println(str.substring(4));
    System.out.println(str.substring(str.lastIndexOf(".")+1));
//    System.out.println(str.substring(-1));//StringIndexOutOfBoundsException: String index out of range: -1
//    System.out.println(str.substring(4,100));//StringIndexOutOfBoundsException: String index out of range: 100
    System.out.println(str.length());//38
    System.out.println(str.substring(7,37));
    System.out.println(str.substring(7,38));

  }
}
